use ztask::task::*;
use std::iter;

fn main() {
    let mut root = Repeat::new(
        iter::once(
            Lock::new(
                AfterIterator::new(0..10, |num| println!("print {}", num)),
                Log::new("Printing End!"),
            ) as Box<dyn ITask>
        ),
        AfterTimes::new(20),
    );

    let mut i = 0;

    while !root.is_finished() {
        println!("Current Frame {}", i);
        root.step();

        i += 1;
    }
}